Loading...
 

CXB_MULTIPLE_STRING - MPG

CXB_MULTIPLE_STRING

Class CXB_MULTIPLE_STRING manages multilingual character strings:

 
class CXB_MULTIPLE_STRING
{ public:
CXB_MULTIPLE_STRING(void);
CXB_MULTIPLE_STRING(CXB_MULTIPLE_STRING &);
˜CXB_MULTIPLE_STRING(void);

inline operator char *() { return GetString(); }
int operator&(char *);

char *GetString(void);
char *GetString(int k);
inline int N(void)
{ return n;
}
int NTrue(void);
void Import(char *, int);
CXB_MULTIPLE_STRING &operator=(CXB_MULTIPLE_STRING &);
CXB_MULTIPLE_STRING &operator=(CXB_STRING &);
CXB_MULTIPLE_STRING &operator=(char *);
CXB_MULTIPLE_STRING &operator|=(char *);
CXB_MULTIPLE_STRING &operator+=(char);
CXB_MULTIPLE_STRING &operator+=(char *);
CXB_MULTIPLE_STRING &operator+=(CXB_STRING &);
CXB_MULTIPLE_STRING &operator+=(CXB_MULTIPLE_STRING &);
inline char *operator[](int i)
{ return GetString(i); }

private:
unsigned char n; // number of strings held at the moment
unsigned char g; // g slots allocated (g = m * GRANULARITY,
// m = 1, 2, ...)
CXB_STRING **str; // slots holding the strings
};

Since the operator (char *) has been overloaded, objects of this class can be used like ordinary strings of the type 'char *'. You get the character string corresponding to the current language (see CXB_SYSTEM). Further operations are shown in the following table:

Operator Function Meaning
(char *) Character string in current language (CXB_SYSTEM)
i Character string in the i-th language
= Assignment: a single character string (type 'char *' or 'CXB_STRING') overwrites the character string belonging to the current language
|= imports the string as n+1-th string
+= concatenation, for a single character string with the string belonging to the current language
& TRUE - String exists in object
N() get the number of strings (languages)
NTrue() TRUE - at least one character string > " " exists